import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        StringBuilder sb = new StringBuilder();
        for (int i = str.length() - 1; i >= 0; i--) {
            char ch = str.charAt(i);
            if(ch >= 65 && ch <= 90) {
                ch = (char)(ch + 32);
            } else if (ch >= 97 && ch <= 122) {
                ch = (char)(ch - 32);
            }
            sb.append(ch);
        }
        System.out.println(sb);
    }
}
